import fetch from 'common/src/utils/fetch';

const BASE_URL = '/api/graduationservice';
// 课程组列表
let getCourseGroupList = (data) => {
  return fetch({
    url: `${BASE_URL}/icourse/pageList`,
    method: 'post',
    data
  });
}

// 添加课程组
let addCourseGroup = (data) => {
  return fetch({
    url: `${BASE_URL}/icourse/addGroup`,
    method: 'post',
    data
  });
}

// 删除课程组
let deleteCourseGroup = (data) => {
  return fetch({
    url: `${BASE_URL}/icourse/delGroup`,
    method: 'DELETE',
    data
  });
}

// 添加课程
let addCourse = (data) => {
  return fetch({
    url: `${BASE_URL}/icourse/addCourse2Group`,
    method: 'post',
    data
  });
}

// 修改课程组学分
let editGroupCredit = (data) => {
  return fetch({
    url: `${BASE_URL}/icourse/editGroupCredit`,
    method: 'PUT',
    data
  });
}

// 删除课程组下的课程
let delCourse = (data) => {
  return fetch({
    url: `${BASE_URL}/icourse/delGroupCourse`,
    method: 'DELETE',
    data
  });
}

// 查询课程接口
let getCourese = (data) => {
  return fetch({
    url: '/api/cultureservice/bclCourses/pageList',
    method: 'post',
    data
  });
}

//查询机审详情
let getMachineDetail = (studentID) => {
    return fetch({
        url: `/api/graduationservice/graduateList//getMachineDetailForGJ?studentID=${studentID}`,
        method: 'get'
    })
}
/**
 * 查询当前学生上一位、下一位的学生id
 * step 0:下一步；1：上一步
 * isOverseas 0:国内生；1留学生
 * currentStudentId :当前学生ID
 */
let  findPreviousOrNextStep = (data) =>{
    return fetch ({
        url:`/api/graduationservice/graduateList/findPreviousOrNextStep`,
        method: 'post',
        data
    })
}
export {
  getCourseGroupList,
  addCourseGroup,
  deleteCourseGroup,
  addCourse,
  editGroupCredit,
  delCourse, 
  getCourese,
  getMachineDetail,
  findPreviousOrNextStep
}